#include "camprec.h"
#include "FEAElementsFaces.h"

CFEAElementsFaces::CFEAElementsFaces(): Parent(0)
{
}

CFEAElementsFaces::~CFEAElementsFaces(void)
{
	Free ();
}


CFEAElementFaces *CFEAElementsFaces::Add ( CFElement *pFElement)
{
	CFEAElementFaces *pFEAElementFaces = new CFEAElementFaces (pFElement);

	pFEAElementFaces->Parent = this;

	FEAElementsFacesVector.push_back (pFEAElementFaces);

	return pFEAElementFaces;
}



CFEAElementFaces *CFEAElementsFaces::Get (const DWORD &Index)
{
	if (Index < Count ())
		return FEAElementsFacesVector [Index];

	throw cam_exc_critical_error (_T("CFEAElementMesh *CFEAElementsMesh::Get Index invalid!"));
}


void CFEAElementsFaces::Free ()
{
	while (!FEAElementsFacesVector.empty())
	{
		delete FEAElementsFacesVector.back();
		FEAElementsFacesVector.pop_back();
	}
}
